<?php
class Maven_ManageCatalogSpr_Model_Mysql4_Importlog extends Mage_Core_Model_Mysql4_Abstract
{
	public function _construct()
	{
		$this->_init('managecatalogspr/importlog', 'id');
	}
	public function getCountData($estatus='')
	{
		$select = $this->_getReadAdapter()->select()
			->from(array('main_table'=>$this->getTable('managecatalogspr/importlog')),
				array('total'=>'count(id)'));
		if($estatus!='')
			$select->where('main_table.estatus in ('.$estatus.')');
		$res = $this->_getReadAdapter()->fetchAll($select);
		if(isset($res[0]['total'])) {
			return $res[0]['total'];
		}
	}
	public function getSuccessCount()
	{
		return $this->getCountData(1);
	}
	public function getFailCount()
	{
		return $this->getCountData(2);
	}
	public function getPendingCount()
	{
		return $this->getCountData(0);
	}
}